﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EHU_InterfaceProgramming
{
    public class circleGestureParts
    {

        int tempx;
        int tempy;

        /// <summary>
        /// Checks that left hand is above head.
        /// </summary>
        /// <param name="pe">The Person to check</param>
        /// <returns>Boolean Value, true if detected, false if not</returns>
        public Boolean part1 (Person pe)
        {
            if (pe.jHandLeft.X > pe.jHead.X)
            {
                tempx = pe.jHandLeft.X;
                tempy = pe.jHandLeft.Y;
                return true;
            }
            else { return false; }
        }
        /// <summary>
        /// Checks that the hand has moved in a clockwise direction from its first position.
        /// </summary>
        /// <param name="pe">The person to check.</param>
        /// <returns>A Boolean value, true if detected, false if not.</returns>
        public Boolean part2(Person pe)
        {
            if (pe.jHandLeft.X < tempx && pe.jHandLeft.Y > tempy)
            {
                tempy = pe.jHandLeft.Y;
                tempx = pe.jHandLeft.X;
                return true;
            }
            else { return false; }
        
        }
        /// <summary>
        /// Checks that the hand has moved in a clockwise direction from its second position.
        /// </summary>
        /// <param name="pe">The person to check.</param>
        /// <returns>A Boolean value, true if detected, false if not.</returns>
        public Boolean part3(Person pe)
        {
            if (pe.jHandLeft.X < tempx && pe.jHandLeft.Y < tempy)
            {
                tempx = pe.jHandLeft.X;
                tempy = pe.jHandLeft.Y;
                return true;
            }
            else { return false; }
        }
        /// <summary>
        /// Checks that the hand has moved in a clockwise direction from its third position.
        /// </summary>
        /// <param name="pe">The person to check.</param>
        /// <returns>A Boolean value, true if detected, false if not.</returns>
        public Boolean part4 (Person pe)
        {
            if (pe.jHandLeft.X > tempx && pe.jHandLeft.Y < tempy)
            {
                return true;
            }
            else {return false;}
        }

           

    }

    class pushUpGestureParts
    {
        /// <summary>
        /// CHecks to see that hands are below head.
        /// </summary>
        /// <param name="pe">The Person detected</param>
        /// <returns>Boolean Value, true if detected, false if not</returns>
        public Boolean part1(Person pe)
        {
            if (pe.jHandLeft.X < pe.jHead.X && pe.jHandRight.X < pe.jHead.X)
            {
                return true;
            }
            else { return false; }
        }
        /// <summary>
        /// Checks to see if hands are above head
        /// </summary>
        /// <param name="pe">The Person to check.</param>
        /// <returns>Boolean Value, true if detected, false if not</returns>
        public Boolean part2(Person pe)
        {
            if (pe.jHandLeft.X > pe.jHead.X && pe.jHandRight.X > pe.jHead.X)
            {
                return true;
            }
            else { return false; }
        }
        /// <summary>
        /// Checks to see if hands are below head again.
        /// </summary>
        /// <param name="pe">The Person to check.</param>
        /// <returns>Boolean Value, true if detected, false if not</returns>
        public Boolean part3(Person pe)
        {
            if (pe.jHandLeft.X < pe.jHead.X && pe.jHandRight.X < pe.jHead.X)
            {
                return true;
            }
            else { return false; }
        }

    }
   
    public class armsCrossedParts
    {
        /// <summary>
        /// Checks to see if the persons arms are crossed, below the elbows.
        /// </summary>
        /// <param name="pe">The Person to check.</param>
        /// <returns>Boolean Value, true if detected, false if not</returns>
        public Boolean part1 (Person pe)
        {
         if (pe.jHandLeft.Y > pe.jElbowRight.Y && pe.jHandRight.Y < pe.jElbowLeft.Y)
         {
             return true;
         }
         else{return false;}
        }
        /// <summary>
        /// Checks to see if the persons arms are crossed above the elbows.
        /// </summary>
        /// <param name="pe">The Person to check.</param>
        /// <returns>Boolean Value, true if detected, false if not.</returns>
        public Boolean part2 (Person pe)
        {
            if( pe.jHandRight.X > pe.jElbowRight.X && pe.jHandLeft.X >pe.jElbowLeft.X && pe.jHandLeft.Y> pe.jHandRight.Y)
            {
                return true;
            }
            else{return false;}
        }

    }

}
